﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CH.TestData.Common;
namespace CH.TestData.Provider
{
    [DataTypeName("邮件地址")]
    public class EmailProvider : IDataProvider
    {

        List<string> l1 = new List<string>() 
            {
                "yahoo", 
                "sina",
                "qq", 
                "163",
                "126", 
                "gmail"
            };

        List<string> l2 = new List<string>() 
            {
                "com", 
                "net",
                "org"
            };
        public void SetDataSource(FlowLayoutPanel flp)
        {

        }
        public void CreateOption(FlowLayoutPanel flp)
        {

        }

        public string GetNextValue()
        {
            return "N'" + RandomHelper.GetRandomString(new Random(Guid.NewGuid().GetHashCode()).Next(5, 20)) + "@" + l1[new Random(Guid.NewGuid().GetHashCode()).Next(0, l1.Count - 1)] + "." + l2[new Random(Guid.NewGuid().GetHashCode()).Next(0, l2.Count - 1)] + "'";
        }
    }
}
